<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<ui:composition template="../template.xhtml">
	<ui:define name="conteudo">
		<h:form>
			<p:panel id="panelLogin" style="border: 0; width: 50%;">
				<p:panelGrid id="panelGridLogin" columns="2">
					<f:facet name="header">  
        				Formulário de Cadastro de Usuários
    				</f:facet>

					<h:outputLabel for="nome" value="Nome: *" />
					<p:inputText id="nome" size="50" value="#{usuarioAction.usuario.nome}" title="Insira o nome do usuário." required="true" label="Nome">
					<p:tooltip for="nome" showEvent="focus" hideEvent="blur" /> 
					</p:inputText>

					<h:outputLabel for="email" value="Email: *" />
					<p:inputText id="email" size="50" value="#{usuarioAction.usuario.email}" title="Insira o email do usuário." required="true" label="Email">
					<p:tooltip for="email" showEvent="focus" hideEvent="blur" /> 
					</p:inputText>
					
					<h:outputLabel for="telefone" value="Telefone: *" />
					<p:inputMask id="telefone" size="50" value="#{usuarioAction.usuario.telefone}" title="Insira o telefone do usuário." required="true" label="Telefone" mask="(99) 9999-9999">
					<p:tooltip for="telefone" showEvent="focus" hideEvent="blur" /> 
					</p:inputMask>

					<h:outputLabel for="login" value="Login: *" />
					<p:inputText id="login" size="50" value="#{usuarioAction.usuario.login}" title="Insira o login do usuário." required="true" label="Login" >
					<p:tooltip for="login" showEvent="focus" hideEvent="blur" /> 
					</p:inputText>
					
					<h:outputLabel for="senha" value="Senha: *" />
					<p:password id="senha" size="50" value="#{usuarioAction.usuario.senha}" title="Insira a senha do usuário." match="confSenha" required="true" label="Senha" feedback="true" promptLabel="Insira a senha do usuário" weakLabel="Senha Fraca" goodLabel="Senha Moderada" strongLabel="Senha Forte">				
					</p:password>
					
					<h:outputLabel for="confSenha" value="Confirme a Senha: *" />
					<p:password id="confSenha" size="50" value="#{usuarioAction.usuario.senha}" title="Confirme a senha inserida do usuário." required="true" label="Confirmação da Senha">
					<p:tooltip for="confSenha" showEvent="focus" hideEvent="blur" /> 
					</p:password>

					<f:facet name="footer">
						<p:commandButton value="Salvar" icon="ui-icon-check" ajax="false"
							style="margin:0; width:100%; align: right" action="#{usuarioAction.salvarUsuario()}" />
					</f:facet>
				</p:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>
